package com.example.lhsama.controller;

import com.example.lhsama.domain.Category;
import com.example.lhsama.domain.Permission;
import com.example.lhsama.service.CategoryService;
import com.example.lhsama.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @Date: 2021年10月29日 12:53
 * @Author: LHSAMA
 */
@Controller
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private PermissionService permissionService;

    @RequestMapping("/list")
    public ModelAndView list(){
        ModelAndView mv = new ModelAndView();
        List<Permission> permissions = permissionService.list();
        mv.addObject("permissions",permissions);
        mv.setViewName("permission_list");

        return mv;

    }

}
